<?php
try{
	define('N_MYCONF','index');
	define('N_ADMIN','Y');
	include 'core/Init.php';

	$n = new Controller();
	//$d = n_api("debug")->set('dev');	//[0:dev,1:test,2:alpha,3:beta,4:public]

	if(!in_array(N_EVENT,array("open","error","install")) && N_SCRIPT!='cli'){
		n_api("passport")->startSession();
		if(n_api("passport")->isLogin() == false && !in_array(N_ACTION, array("login","dologin","vcode","wapVcode","doreg"))){
			n_go(n_url('passport','login'));
			exit();
		}
	}

	$n->run();

}catch(CException $c){
	n_fault($c);

}catch(PException $p){
	n_alert($p);

}catch(exception $e){
	n_ufo($e);

}


n_debug();
